﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Altairis.FluffyCloud.Data {
    public class TopicPost {

        [Key]
        public Guid TopicPostId { get; set; }

        [Required]
        public int TopicId { get; set; }
        public virtual Topic Topic { get; set; }

        [Required]
        public string UserName { get; set; }
        public virtual User User { get; set; }

        public DateTimeOffset DateCreated { get; set; }

        [Required, DataType("WikiMarkup")]
        public string Text { get; set; }

        [MaxLength(39)]
        public string IpAddress { get; set; }

        public TopicPost() {
            this.DateCreated = DateTimeOffset.UtcNow;
            this.TopicPostId = Guid.NewGuid();
        }

    }
}
